﻿using LayoutHelpers.Primitives;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;

namespace LayoutHelpers.BaseTypes
{
  public class GoToVisualStateRuleBase<T> : TypedConditionalLayoutRuleBase<T, GoToVisualStateCommand>
    where T : ILayoutEvaluator, new()
  {
    virtual public bool UseTransitions
    {
      get { return TypedTrueCommand.UseTransitions; }
      set { TypedTrueCommand.UseTransitions = value; }
    }

    virtual public string VisualStateName
    {
      get { return TypedTrueCommand.VisualStateName; }
      set { TypedTrueCommand.VisualStateName = value; }
    }

    virtual public string VisualStateNameIfFalse
    {
      get { return TypedFalseCommand.VisualStateName; }
      set
      {
        if (TypedFalseCommand == null)
        {
          TypedFalseCommand = new GoToVisualStateCommand
          {
            UseTransitions = TypedTrueCommand.UseTransitions
          };
        }
        TypedFalseCommand.VisualStateName = value;
      }
    }
  }
}
